<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>主贴</title>
<link rel="stylesheet" type="text/css" href="css/common.css">
</head>
<body>
	<jsp:include page="header.jsp"></jsp:include>
	<nav>
		<div>
			<a href="index.do">首页</a><span>>></span>
			<a href="topic.do?sid=${sid }&page=1">${sname }</a>
		</div>
	</nav>
	<table border="1">
		<tr>
			<td>主贴标题</td>
			<td>回帖数量</td>
			<td>发帖人</td>
		</tr>
		<c:forEach var="topic" items="${topicList }">
			<tr>
				<td><a href="replay.do?tid=${topic.topic.tid }&page=1">${topic.topic.ttitle }</a></td>
				<td>${topic.replayCount }</td>
				<td><a href="user.do?uid=${topic.userId }">${topic.mname }</a></td>
			</tr>
		</c:forEach>
	</table>
	<div class="pageCon">
		<a href="topic.do?sid=${sid }&page=1">第一页</a>
		<c:forEach var="page" items="${pageList }">
			<c:if test="${page!=currentPage }">
				<a href="topic.do?sid=${sid }&page=${page }">[${page }]</a>
			</c:if>
			<c:if test="${page==currentPage }">
				<span>[${page }]</span>
			</c:if>
		</c:forEach>
		<c:if test="${not empty loginUser }">
			<h4>发帖</h4>
			<form>
				
			</form>
		</c:if>
		<a href="topic.do?sid=${sid }&page=${lastPage }">最后一页</a>
	</div>
	<jsp:include page="footer.jsp"></jsp:include>
</body>
</html>